package com.hudsonmq.spring.domain.consume;

import io.netty.channel.Channel;

public class PushRequest {

    private Channel channel;
    private String topic;
    private int queueId;
    private int size;
    private long lastConsumeTime;


    public PushRequest(Channel channel, String topic, int queueId, int size) {
        this.channel = channel;
        this.topic = topic;
        this.queueId = queueId;
        this.size = size;
    }


    public String getTopic() {
        return topic;
    }

    public void setTopic(String topic) {
        this.topic = topic;
    }

    public int getQueueId() {
        return queueId;
    }

    public void setQueueId(int queueId) {
        this.queueId = queueId;
    }

    public int getSize() {
        return size;
    }

    public void setSize(int size) {
        this.size = size;
    }

    public Channel getChannel() {
        return channel;
    }

    public void setChannel(Channel channel) {
        this.channel = channel;
    }

    public long getLastConsumeTime() {
        return lastConsumeTime;
    }

    public void setLastConsumeTime(long lastConsumeTime) {
        this.lastConsumeTime = lastConsumeTime;
    }

    /**
     * 获取请求参数的唯一标识
     * 判断是否超过固定时间未拉取消息主动拉取
     * @return
     */
    public String getRemark() {
        return channel.id().asShortText() +
                topic +
                queueId;
    }
}
